//
//  XDSynViewController.m
//  iphone.mobileoa
//
//  Created by 李亚春 on 13-5-24.
//  Copyright (c) 2013年 Epoint. All rights reserved.
//

#import "XDSynViewController.h"
#import "DBFrameService.h"
#import "SynTask.h"

@interface XDSynViewController ()

@end

@implementation XDSynViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.lbSynTime.text = [DBFrameService getConfigValue:EP_ConfigKey_syntime];
    
    [UITool setGlossyButtonWithRed:68.0f green:151.0f blue:200.0f :[self.view viewWithTag:1001]];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)synAction:(id)sender {
    [self showMBPHUDWithMessage:@"正在同步数据..."];
    syntaskguid = [[[SynTask alloc]initWithContext:self andParams:self.getPassDictionary]startTask];
}

-(void)refreshUIWithThreadGuid:(NSString *)threadGuid andData:(NSObject *)obj
{
    [self hideMBPHUD];
    if ([syntaskguid isEqualToString:threadGuid]) {
        self.lbSynTime.text = [DBFrameService getConfigValue:EP_ConfigKey_syntime];
    }
}

- (void)dealloc {
    [_lbSynTime release];
    [super dealloc];
}
- (void)viewDidUnload {
    [self setLbSynTime:nil];
    [super viewDidUnload];
}
@end
